package com.tg.app.activity.device.add;

import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;

import androidx.annotation.Nullable;

import com.tg.app.R;
import com.base.BaseActivity;
import com.tg.app.helper.ActivityHelper;

public class ResetDeviceSoundActivity extends BaseActivity implements  CheckBox.OnCheckedChangeListener, View.OnClickListener {
    private Button mButton;
    private String mUUID;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);//remove title bar  即隐藏标题栏
        setContentView(R.layout.activity_reset_device_sound);
        hideActionBar();
        if (getIntent() != null){
            mUUID = getIntent().getStringExtra(ApSetWifiActivityEx.EXT_WIFI_UUID);
        }
        initView();
    }

    @Override
    public boolean shouldSetStatusBarColor() {
        return true;
    }

    protected void initView() {
        mButton = findViewById(R.id.next);
        ActivityHelper.setLoginStyleButtonEnable(mButton, false);
        mButton.setOnClickListener(this);
        CheckBox checkBox = findViewById(R.id.cb_message_filter_device_all);
        checkBox.setOnCheckedChangeListener(this);
        modifyToolBar(null, false);
        findViewById(R.id.back_toolbar).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
        ActivityHelper.setLoginStyleButtonEnable(mButton, b);
    }

    @Override
    public void onClick(View view) {
        int id = view.getId();
        if (id == R.id.next) {
            ActivityHelper.goToBindActivity(ResetDeviceSoundActivity.this, mUUID, ScanQrcodeActivity.EXT_FROM_HISTROY);
        }
    }
}
